package edu.kit.ksri.db.mturk.standaloneutils;

import java.io.PrintWriter;

/**
 * Copyright (c) 2010-2011 Karlsruhe Institute of Technology (KIT), Germany
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 * 
 * --------------------------------------------------------------------------
 * 
 * Software: CSP/WMV tool for dynamic quality management of microtasks
 * http://www.ksri.kit.edu/Upload/Users/PeopleClouds/HCOMP2011_An_extendable_toolkit_for_managing_quality_of_human-based_eServices.pdf
 * 
 * Organization: Karlsruhe Institute of Technology (KIT), Germany
 * http://www.kit.edu
 * 
 * Project: PeopleClouds project of the Karlsruhe Service Research Institute(KSRI)
 * http://www.ksri.kit.edu/Default.aspx?PageId=818
 * 
 * Contributing authors: David Bermbach, Sandra Rath, Pascal Wichmann, Robert Kern
 * 
 * ---------------------------------------------------------------------------
 * 
 * Purpose: Creates the input file, e.g. ocr.input for MTurk.
 * 
 * Urls are in the form of<br><br>
 * [url][prefixBeforeNumber][firstNumber<=?<=lastNumber][suffixAfterNumber]<br><br>
 * Example: http://www.audiochat.eu/ocr1.jpg
 * <br><br>Target file is specified below   
 */
public class HITInputCreator {

	private static final String targetFile = "ocr.input";
	
	private static final int firstNumber = 1;
	private static final int lastNumber = 1176;
	private static final String url = "http://www.audiochat.eu/";
	private static final String prefixBeforeNumber = "ocr";
	private static final String suffixAfterNumber = ".jpg";

	public static void main(String[] args) throws Exception{
		PrintWriter pw = new PrintWriter(targetFile);
		pw.println("urls");
		String output = null;
		for(int i = firstNumber;i<=lastNumber;i++){
			output = url+prefixBeforeNumber+i+suffixAfterNumber;
			System.out.println("Writing: "+output);
			pw.println(output);
		}
		pw.flush();
		pw.close();
	}

}
